Skip to main content

Posts

Showing posts with the label Data Science

What is SUTVA for A/B testing?

Imagine if person B’s blood pressure reading depends on whether person A receives the blood pressure medicine in a randomized controlled trial. This will be violating Stable Unit Treatment Value Assumption (SUTVA) SUTVA states that the treatment received by an individual should not influence the outcome we see for another individual during the experiment. I know the initial example sounded absurd, so let me try again. Consider LinkedIn A/B testing a new ‘dislike’ reaction for its users, and the gods of fate chose you to be part of the initial treatment group that received this update. Excited after seeing this new update, you use this dislike reaction on my post and send a screenshot to a few of your connections to do the same, who are coincidentally in the control group that did not receive the update. Your connections log in and engage with my posts to use this dislike reaction, but later get disappointed as this new update is not yet available to them. The offices of LinkedIn are tr...

A practical advice about building models

One of the most practical pieces of advice I recently learned about building models is counterintuitive. It suggests that we should not immediately jump into training models on the data. Instead, we should first try to create heuristic rules for the prediction problem at hand. For example, if we are trying to predict whether a customer will buy the latest edition of the iPhone or not, a simple heuristic rule would be that customers with an annual income greater than $80,000 USD and a history of purchasing Apple products would have a higher probability of buying the new iPhone. You could write a simple SQL query to test out such heuristic rules on your training and holdout sets and evaluate their effectiveness. This approach could sometimes help you create better features, identify inherent target leakage issues, and provide a baseline that you could aim to beat with the models.

Solving Customer Churn with a hammer!

Learning when data should take a back seat and give way to domain knowledge is a valuable skill. Suppose you built a machine learning model on the data of your customers to predict churn risk. Now that you have a risk score for each customer, what do you do next? Do you filter the top n% based on the risk and send them a coupon with a discount in the hopes that it will prevent churn? But what if price is not the factor driving churn in many of these customers? Customers might have been treated poorly by customer service, which drove them away from your company's product.  Or there might have been an indirect competitor's product or service that removes the need for your company's product altogether (this happened to companies like Blockbuster and Kodak in the past!) There could be a myriad of factors, but you get the point! Dashboards and models cannot guide any company's strategic actions directly. If companies try to use them without additional context, more often tha...

The Gambler's fallacy

In a world riddled with conflicts and disagreements, we all can wholeheartedly agree that the probability of my articles becoming viral and the Bitcoin price seeing a 1000% increase is not only independent but also extremely unlikely. If I claim that these two events are dependent in an attempt to gain engagement from the large crypto community, does it not make me a conman? Or I could simply be a common man (or a conspiracy theorist) who mistakenly perceives independent events as somehow interconnected. Another group that commonly struggles with this issue is individuals with gambling addictions. Don’t we all have those friends (or in a few cases, we were those friends) who experienced consecutive losses in gambling but persisted because they believed their turn to win was imminent? It could be portrayed as a tale of remarkable persistence and unwavering determination when that friend miraculously wins a significant sum of money, potentially bankrupting the casino. However, there is o...

Can you defeat Monty Hall to win a Batmobile?

  You slipped after accidentally stepping on a banana peel and somehow fell into another dimension where people are in game shows all the time. As you dust yourselves off and stand up, you realize you are in the 1960s version of the game show “Let’s Make a Deal.” The host of this show, the late Monty Hall, looks at you suspiciously at first but later presents three doors in front of you and asks you to choose one. You don’t trust strangers, so you demand to know what’s happening before you make your next move. Monty Hall patiently explains that there’s a brand new Batmobile behind one of the doors (yes, Batman is real in this dimension), and goats behind the other doors. You could own the Batmobile if you correctly guess the door behind which it was hidden. You pull your Batsuit out of your pocket to don the mask of the world’s greatest detective (as per DC Comics) and analyze the three doors with a careful gaze. You look meticulously for any minuscule details that might give away ...

A random problem of decision tree

There's something you need to know about if you are building decision tree models using Python's famous scikit-learn package. The algorithm it uses for building the models is deterministic (it produces consistent results across multiple executions if the inputs don't change). Despite this nature, scikit-learn provides a 'Random state' hyperparameter to the decision tree's class. This hyperparameter is only needed when an algorithm is not deterministic, as fixing the random state to a constant integer value arrests the randomness. So, the random state must be a redundant parameter when building decision trees, right? Not really. The decision tree algorithm could use the value of the random state passed to it for making a 'decision' in the below three cases: i) If you set the max_features hyperparameter to an integer value lesser than the total number of features. It means the algorithm needs to decide which random subset of features to use at each node to...

What is a common challenge faced by engineers, thieves, and business decision-makers?

There was a time when the only source of transportation for humans was on foot. But the invention of the wheel changed the game, as it allowed them to cover longer distances than before without expending as much energy. Further inventions such as steam locomotives and airplanes have only expanded this distance limit. And now, with the advent of rockets, spacecraft, and rovers, we have begun to explore other planets in our solar system that are millions of kilometers away! On a higher level, we can understand that our world-class engineers are in the business of expanding our horizons. However, on a much deeper level, they are indeed grappling with the challenges like improving the conversion efficiency of fuel energy into mechanical energy, refining engine designs, and developing better materials.  For example, consider the example of steam engines. When these engines were invented, they marveled the world with their ability to perform mechanical work using water. However, this pro...